package com.gt.xmall.log;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.gt.xmall.log.model.SysDataLog;
import com.gt.xmall.log.repository.SysDataLogRepository;
import com.gt.xmall.util.ApplicationUtil;

@Controller
@RequestMapping(value = "/log/")
public class DataLogShowController {
	Logger log = LoggerFactory.getLogger(this.getClass());
	
	SysDataLogRepository sysDataLogRepository;
	@RequestMapping(value = "show",method = RequestMethod.GET)
	public String show(Model model) {
		sysDataLogRepository =(SysDataLogRepository) ApplicationUtil.getSpringBeanByName( "applicationContext-mongo.xml","sysDataLogRepository");
		List<SysDataLog> logs = sysDataLogRepository.findAll();
		model.addAttribute("logList", logs);
		return "logs/show";
	}
}
